import {
  Entity,
  PrimaryGeneratedColumn,
  Column,
  CreateDateColumn,
  UpdateDateColumn,
} from "typeorm";

@Entity("xy-user")
export class User {
  @PrimaryGeneratedColumn()
  id!: number;

  @Column({ length: 100, unique: true })
  job_no!: string;

  @Column({ length: 100, nullable: true })
  name!: string;

  @Column({ length: 1, nullable: true })
  sex!: string;

  @Column({ length: 20, nullable: true })
  tel!: string;

  @Column({ length: 50, nullable: true })
  email!: string;

  @Column({ length: 200, nullable: true })
  address!: string;

  @Column({ length: 50, nullable: true })
  status!: string;

  @Column({ length: 1, default: "N" })
  is_super!: string;

  @Column({ length: 100, nullable: true })
  created_by!: string;

  @CreateDateColumn()
  created_at!: Date;

  @Column({ length: 100, nullable: true })
  updated_by!: string;

  @UpdateDateColumn()
  updated_at!: Date;
}
